﻿<!-- 教学计划-计划查询 -->
<template>
    <div>
        <!-- 添加按钮 -->
        <div class="btn-add">

        </div>
        <!-- 按条件选择 -->
        <div class="tab-filter-type ">

            <div class="col-xs-3 padding20">
                <div class="input-group" style="margin-bottom:10PX;">
                    <div class="input-group-btn">
                        <button type="button" style="height: 34px;min-width:80PX" class="btn btn-primary  dropdown-toggle">年级</button>
                    </div>
                    <base-nj :pzoption="query.nj"></base-nj>
                </div>
            </div>
            <div class="col-xs-5 padding20">
                <div class="input-group" style="margin-bottom:10PX;">
                    <div class="input-group-btn">
                        <button type="button" style="height: 34px;min-width:80PX" class="btn btn-primary  dropdown-toggle">专业系部</button>
                    </div>
                    <base-xb :pzoption="query.xb" isqx isjx isdx></base-xb>

                </div>
            </div>
        </div>

        <div class="default-tab ft14  hover-btn" style="overflow-x: inherit;padding:20PX;padding-top:10px">
            <base-table :pzoption="tableop" @selection-change="handleSelectionChange">
            </base-table>
        </div>
        <!-- 表格 -->



    </div>
</template>

<script>
    module.exports = {
        props: ['pdata'],
        components: {
            'base-table': httpVueLoader('/ViewV5/Base/Vue/elTable.vue'),
            'base-nj': httpVueLoader('/ViewV5/AppPage/QJJW/component/connj.vue'),
            'base-xb': httpVueLoader('/ViewV5/AppPage/QJJW/component/conxb.vue?v=2'),

        },
        data: function () {
            return {
                query: {
                    nj: { value: "" },
                    xb: { value: [] },

                },
                tableop: {
                    title: "年级专业信息",
                    issel: true,
                    iscz: false,
                    height: 500,
                    isxh: true,
                    loading: true,
                    dataset: [],
                    multipleSelection: [],
                    czltabledata: [
                        {
                            colname: "管理计划", bttype: "primary", isshow: true, mangefun: function (rowdata) {
                                this.$root.addTab("/ViewV5/AppPage/QJJW/Vue/JHGL_JHGLItem", rowdata.zymc, rowdata, "");
                            },
                        },
                    ],
                    collist: [
                        { colid: "zymc", colname: "专业名称", isshow: true, istip: true },
                        { colid: "zydm", colname: "专业代码", isshow: true, istip: true },
                        { colid: "xbmc", colname: "系部名称", isshow: true, istip: true },
                        { colid: "nj", colname: "年级", isshow: true, istip: true },
                        { colid: "jhsrqk", colname: "计划输入情况", isshow: true, istip: true },
                        { colid: "xz", colname: "学制", isshow: true, istip: true },
                        { colid: "fxdm", colname: "方向代码", isshow: true, istip: true },
                        { colid: "zyfx", colname: "专业方向", isshow: true, istip: true },
                        { colid: "bjxx", colname: "适用班级", isshow: true, istip: false },


                    ]
                }
            }
        },
        methods: {
            handleSelectionChange(val) {
                this.tableop.multipleSelection = val;
            },
            querydata: function () {
                var pro = this;
                pro.tableop.loading = true;
                if (pro.query.xb.value.join()) {
                    $.getJSON('/API/VIEWAPI.ashx?Action=JXJH_GETNJZY', { nj: pro.query.nj.value, xbdm: pro.query.xb.value.join() }, function (resultData) {
                        if (!resultData.ErrorMsg) {
                            pro.tableop.dataset = resultData.Result;
                            pro.tableop.loading = false;
                        }
                    })
                }
            

            },

            InitWigetData: function () {
                this.querydata();
            },
        },
        watch: {
            'query': { //深度监听，可监听到对象、数组的变化
                handler(newV, oldV) {
                    var chi = this;
                    if (newV) {
                        chi.querydata();
                    }
                },
                deep: true
            }
        },
        mounted: function () {
            var pro = this;
            pro.$nextTick(function () {
                pro.InitWigetData();
            })

        }
    };
</script>